var t = require("../@babel/runtime/helpers/interopRequireDefault").default;

Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.CheckImgExists = function(t) {
    var e = new Image();
    e.src = t, e.onload = function() {
        return e.fileSize > 0 || e.width > 0 && e.height > 0;
    };
}, exports.compareVersion = function(t, e) {
    t = t.split("."), e = e.split(".");
    var r = Math.max(t.length, e.length);
    for (;t.length < r; ) t.push("0");
    for (;e.length < r; ) e.push("0");
    for (var n = 0; n < r; n++) {
        var o = parseInt(t[n], 10), u = parseInt(e[n], 10);
        if (o > u) return 1;
        if (o < u) return -1;
    }
    return 0;
}, exports.dateFormat = function(t, n) {
    var o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : (0, r.default)();
    return e.default.format(t, n || "YYYY-MM-DD HH:mm:ss", o);
}, exports.debounce = function(t, e) {
    var r;
    return function() {
        var n = this, o = arguments;
        clearTimeout(r), r = setTimeout(function() {
            t.apply(n, o);
        }, e);
    };
}, exports.genCurNum = function() {
    var t = Math.round((Date.now() - 16557408e5) / 8e3);
    return 3e5 + t;
}, exports.getQueryStringFromQrCode = function(t, e) {
    if (!(t = t.split("?")[1])) return null;
    var r = new RegExp("(^|&)" + e + "=([^&]*)(&|$)", "i"), n = t.match(r);
    if (null != n) return unescape(n[2]);
    return null;
}, exports.getYearAndMonth = function() {
    var t = new Date(), e = t.getFullYear(), r = t.getMonth() + 1;
    1 === r.toString().length && (r = "0" + r);
    return String(e) + r;
}, exports.isNumber = function(t) {
    return !Number.isNaN(t) && "string" != typeof t;
}, exports.isObject = n, exports.isUnd = function(t) {
    return void 0 === t;
}, exports.merge = function() {
    for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++) e[r] = arguments[r];
    var n = e.shift(), u = e.shift();
    for (;u; ) n = o(n, u), u = e.shift();
    return n;
}, exports.objToStr = function(t) {
    var e = [];
    for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.push(encodeURIComponent(r) + "=" + encodeURIComponent(t[r]));
    return e.join("&");
}, exports.objToUrl = function(t) {
    var e = [];
    for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.push(encodeURIComponent(r) + "=" + encodeURIComponent(t[r]));
    return "?" + e.join("&");
}, exports.parseToRadian = function(t) {
    return t / 360 * 2 * 3.1415926;
}, exports.testNumber = function(t) {
    return /\d+(\.)?\d+/.test(t) || /^\d+$/.test(t);
}, exports.testPhone = function(t) {
    return /^1[3-9]\d{9}$/.test(t);
}, exports.throttle = function(t, e) {
    var r, n;
    return e || (e = 250), function() {
        var o = this, u = arguments, i = +new Date();
        r && i < r + e ? (clearTimeout(n), n = setTimeout(function() {
            r = i, t.apply(o, u);
        }, e)) : (r = i, t.apply(o, u));
    };
}, exports.unique = function(t) {
    return Array.from(new Set(t));
}, exports.urlToObj = function(t) {
    for (var e = t.split("&"), r = {}, n = 0; n < e.length; n++) {
        var o = e[n].split("=");
        "" !== o[0] && (r[o[0]] = o[1]);
    }
    return r;
};

var e = t(require("../libs/fecha/index")), r = t(require("../libs/fecha/fecha.i18n.js"));

function n(t) {
    return Object.prototype.toString.call(t).indexOf("Object") > -1;
}

var o = function t(e, r) {
    return Object.keys(r).forEach(function(o) {
        var u = r[o];
        Object.prototype.hasOwnProperty.call(e, o) && n(u) ? e[o] = t(e[o], u) : Array.isArray(u) ? e[o] = u.map(function(t) {
            return t;
        }) : e[o] = u;
    }), e;
};